
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IE和FF对于函数定义上的差别2</title>
</head>

<body>
	<pre style="background-color: lightBlue; margin: 40px auto;"><code>
		if(true) {
		  function someFunc(){
		    return 1;
		  };
		} else {
		  function someFunc(){
		    return 2;
		  };
		}
		var notSomeFunc = function someFunc(){
		  return 3;
		};
		alert(someFunc());//在FF下打印“1”， 在IE下打印“3”， 按照js原理，应该是打印“2”
	</code></pre>
	<script>
		if(true) {
		  function someFunc(){
		    return 1;
		  };
		} else {
		  function someFunc(){
		    return 2;
		  };
		}
		var notSomeFunc = function someFunc(){
		  return 3;
		};
		alert(someFunc());
		
	</script>
</body>
</html>
